package ua.pp.fland.multithreading.sorting;

import org.apache.log4j.Logger;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

/**
 * @author Maxim Bondarenko
 * @version 1.0 Jun 29, 2010
 */

public class RandomDataInput implements DataInputController {
    private static final Logger logger = Logger.getLogger(RandomDataInput.class);

    private final int elementsNum;

    public RandomDataInput(int elementsNum) {
        this.elementsNum = elementsNum;
    }

    public List<Integer> getUnsortedData() {
        List<Integer> res = new ArrayList<Integer>() ;

        Random random = new Random();
        for(int i = 0; i < this.elementsNum; i++){
            res.add(random.nextInt(Integer.MAX_VALUE));
            //res.add(random.nextInt(20));
        }

        logger.debug("Generated values: " + res);

        return res;
    }
}
